Current Location: Home> Function Categories> log

log

Natural logarithm
Name:log
Category:math
Programming Language:php
One-line Description:Natural logarithm.

Definition and usage

log() returns natural logarithm.

Example

 <?php
echo lcg_value ( ) ;
?>

Try it yourself

grammar

 log ( x , base )
parameter describe
x Required. A number.
base Optional. If this parameter is specified, log base x is returned.

illustrate

If an optional parameter base is specified, log() returns log base x , otherwise log() returns the natural logarithm of parameter x .

Note: The parameter base is available since PHP 4.3.0. You can calculate any logarithm with n based on b, but in fact, you use the mathematical equation: logb(n) = log(n)/log(b), where log is a natural logarithm.

Similar Functions
  • Returns log(1 + number), and can calculate the exact result even when the value of number is close to zero. log1p

    log1p

    Returnslog(1+number)
  • Returns exp(number) - 1, and can calculate the exact result even when the value of number is close to zero. expm1

    expm1

    Returnsexp(number)-1
  • Display the maximum possible value of a random number mt_getrandmax

    mt_getrandmax

    Displaythemaximumpos
  • Generate a random integer rand

    rand

    Generatearandominteg
  • Further method to sort ceil

    ceil

    Furthermethodtosort
  • Returns the remainder of the floating point number of division fmod

    fmod

    Returnstheremaindero
  • Determine whether it is a legal value is_nan

    is_nan

    Determinewhetheritis
  • Arctangle of two parameters atan2

    atan2

    Arctangleoftwoparame
Popular Articles